﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;

namespace BYServer.Filter
{
    public interface ICheck
    {
        bool Check(Socket Client);
    }
    public class FilterDecorator : ICheck
    {
        private List<ICheck> CheckList = new List<ICheck>();
        public FilterDecorator(params ICheck[] Checks)
        {
            CheckList.AddRange(Checks);
        }
        #region ICheck Members

        public bool Check(Socket Client)
        {
            foreach (ICheck c in CheckList)
            {
                if (c.Check(Client) == false) return false;
            }
            return true;
        }

        #endregion
    }
}
